<md-dialog class="addImportantActivity">
  <md-toolbar style="min-height: 60px;height: 60px;">
    <div class="md-toolbar-tools">
      <h2>{{editState}}重大活动实时展示</h2>
      <span flex></span>
      <md-button class="md-icon-button" ng-click="cancel()">X</md-button>
    </div>
  </md-toolbar>
  <md-dialog-content style="padding:10px 20px;width: 100%;height: calc(100% - 112px);">
    <div layout="column" layout-wrap style="height: 100%;">
      <div layout="row" style="height:55px">
        <md-input-container flex="20">
          <label>活动主题</label>
          <input ng-model="activityManager.configure.activityName" style="font-size: 16px;">
        </md-input-container>
        <span style="width:50px"></span>
        <md-input-container flex="20" >
          <label>开始时间</label>
          <input ng-disabled="activityState === '1004'" ng-model="activityManager.startTime"  type="datetime-local" required>
        </md-input-container>
        <span style="width:20px"></span>
        <md-input-container flex="20">
          <label>结束时间</label>
          <input ng-model="activityManager.endTime"  type="datetime-local">
        </md-input-container>
      </div>
      <div layout="row" layout-align="start center" style="height:55px">
        <label>活动参与省</label>
        <md-radio-group  ng-model="autoComplete.hide" layout="row">
          <md-radio-button ng-disabled="activityState ==='1004'" value="all">全网31省</md-radio-button>
          <md-radio-button ng-disabled="activityState ==='1004'" value="some">特定省份</md-radio-button>
        </md-radio-group>
        <div layout="column" class="mychips" ng-hide="autoComplete.hideChanged(autoComplete.hide)">
          <md-chips readonly="activityState ==='1004'" ng-model="selectedProvince" md-autocomplete-snap md-require-match="true">
            <md-autocomplete
                    md-selected-item="provinceAutoComplete.selectedItem"
                    md-search-text="provinceAutoComplete.searchText"
                    md-items="item in provinceAutoComplete.querySearch(provinceAutoComplete.searchText)"
                    md-item-text="item.provinceName"
                    placeholder="输入省份 (中文/拼音/缩写)">
              <span>{{item.provinceName}}</span>
            </md-autocomplete>
            <md-chip-template>
        <span>
          <strong>{{$chip.provinceName}}</strong>
        </span>
            </md-chip-template>
          </md-chips>
        </div>
      </div>
      <div class="addActivity" layout="column">
        <div>
          功能模块
        </div>
        <div style="width:100%;overflow: auto;margin:0 auto;">
          <table width="113%;">
            <tr ng-repeat="mainModule in activityManager.configModules">
              <td>{{mainModule.moduleName}}</td>
              <td>
                <ul>
                  <li ng-repeat="module in mainModule.childModule">
                    <md-checkbox ng-change="checkboxManager.selectParent(module)" ng-model="module.selected">{{module.moduleName}}</md-checkbox>
                  </li>
                </ul>
              </td>
              <td>
                <ul ng-repeat="module in mainModule.childModule">
                  <li ng-repeat="busLine in module.childModule">
                    <md-checkbox ng-change="checkboxManager.selectChild(module)" ng-model="busLine.selected">{{busLine.moduleName}}</md-checkbox>
                  </li>
                </ul>
              </td>
            </tr>
            <tr>
              <td>显示设置</td>
              <td>
                <ul>
                  <li>
                    <md-checkbox ng-model="activityManager.displaySetting.time">显示活动时间</md-checkbox>
                  </li>
                  <li>
                    <md-checkbox ng-model="activityManager.displaySetting.province">显示活动参与省</md-checkbox>
                  </li>
                </ul>
              </td>
              <td></td>
            </tr>
          </table>
        </div>
      </div>

    </div>
  </md-dialog-content>
  <div class="md-actions" layout="row" style="position:relative;padding-right: 80px;">
    <md-button ng-click="preview()" style="position: absolute;left:50%;background-color:#FF9800;margin-left:-43px;">
      预览
    </md-button>
    <md-button ng-click="cancel()" style="background-color: #FF9800;">
      取消
    </md-button>
    <md-button ng-click="saveActivity()" style="background-color: #FF9800;">
      提交
    </md-button>
  </div>
  <core-loading ng-hide="coreLoading"></core-loading>
</md-dialog>